//------------------------假接口API和方法
//统一管理项目用户相关接口
import request from '@/config/axios'
import type { LoginForm, LoginResponseData, UserResponseData } from './type'

enum API {
  LOGIN_URL = '/user/login',
  USERINFO_URL = '/user/info'
}

export const UserApi = {
  //登录接口方法
  reqLogin: async (data: LoginForm): Promise<LoginResponseData> => {
    return await request.post({ url: API.LOGIN_URL, data })
  },

  //获取用户信息接口方法
  reqUserInfo: async (): Promise<UserResponseData> => {
    return await request.get({ url: API.USERINFO_URL })
  }
}
